import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:张熳
 * Date:2025-09-20
 * Time:15:46
 */
public class Test {
    public static void merge(int[] A,int m,int[] B,int n) {
        int i = m-1;
        int j = n-1;
        int k = m+n-1;
        while (i >= 0 && j >= 0) {
            if (A[i] > B[j]) {
                A[k] = A[i];
                i--;
                k--;
            }else {
                A[k] = B[j];
                j--;
                k--;
            }
        }
        while (i >= 0) {
            A[k] = A[i];
            i--;
            k--;
        }
        while (j >= 0) {
            A[k] = B[j];
            j--;
            k--;
        }
    }
    public static void main(String[] args) {
        int[] A = {4,5,6,0,0,0};
        int[] B = {1,2,3};

        merge(A,3,B,3);
        System.out.println(Arrays.toString(A));
    }
    public static String fun(String str) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (stringBuilder.indexOf(ch+"") == -1) {
                stringBuilder.append(ch);
            }
        }
        return stringBuilder.toString();
    }
    public static void main1(String[] args) {
        String s = "BAabB";
        System.out.println(fun(s));
    }
}
